package day15;

/**
 * 临时工类
 * 按每小时50元支付
 */
public class Floater extends Employee {
    // 每小时工资为50元
    private static final double HOURLY_SALARY = 50.0;
    
    // 工作小时数
    private int workHours;
    
    /**
     * 构造方法
     * @param name 员工姓名
     * @param gender 员工性别
     * @param birthDate 员工出生日期
     * @param workHours 工作小时数
     */
    public Floater(String name, String gender, String birthDate, int workHours) {
        super(name, gender, birthDate, "临时工");
        this.workHours = workHours;
    }
    
    /**
     * 计算临时工工资
     */
    @Override
    public void computeSalary() {
        double salary = workHours * HOURLY_SALARY;
        System.out.println("临时工 " + name + " 本月工资为 " + salary + " 元。");
    }
    
    // workHours的getter和setter方法
    public int getWorkHours() {
        return workHours;
    }
    
    public void setWorkHours(int workHours) {
        this.workHours = workHours;
    }
}